cmake_minimum_required(VERSION 2.6)

IF (NOT CMAKE_MODULE_PATH)
  SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules" CACHE PATH "Path for CMake modules")
ENDIF()

FIND_PACKAGE(SWIG REQUIRED)
INCLUDE(${SWIG_USE_FILE})

SET(PHP_INCLUDE_PATHS
  	/usr/include/php
	/usr/include/php/main
	/usr/include/php/TSRM
	/usr/include/php/Zend 
	/usr/include/php/ext 
	/usr/include/php/ext/date/lib
  )

FIND_PACKAGE(DoQuMeasures REQUIRED)


INCLUDE_DIRECTORIES(${PHP_INCLUDE_PATHS})
INCLUDE_DIRECTORIES(${DoQuMeasures_INCLUDE_DIRS})


MESSAGE(${DoQuMeasures_DEFINITIONS})
ADD_DEFINITIONS(${DoQuMeasures_DEFINITIONS})


SET(CMAKE_SWIG_FLAGS "")

SET(CMAKE_CXX_FLAGS "-undefined suppress -flat_namespace")


SET_SOURCE_FILES_PROPERTIES(example.i PROPERTIES CPLUSPLUS ON)
#SET_SOURCE_FILES_PROPERTIES(example.i PROPERTIES SWIG_FLAGS "")
SWIG_ADD_MODULE(example php
  example.i)
SWIG_LINK_LIBRARIES(example	${DoQuMeasures_LIBRARIES})

#g++ -bundle -undefined suppress -flat_namespace   example.o example_wrap.o   -o example.so
